package com.puff.mapper;

import com.github.pagehelper.Page;
import com.puff.annotation.AutoFill;
import com.puff.dto.ShopCategoryDTO;
import com.puff.dto.ShopCategoryPageQueryDTO;
import com.puff.entity.ShopCategory;
import com.puff.enumeration.OperationType;
import com.puff.vo.DishVO;
import com.puff.vo.ShopCategoryVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ShopCategoryMapper {

    /**
     * 根据id查询商家分类
     * @param id
     * @return
     */
    @Select("select * from shop_category where id = #{id}")
    ShopCategory getById(Long id);

    /**
     * 新增商家分类
     * @param shopCategory
     */
    @AutoFill(OperationType.INSERT)
    void insert(ShopCategory shopCategory);

    /**
     * 商家分类分页查询
     * @param shopCategoryPageQueryDTO
     * @return
     */
    Page<ShopCategoryVO> pageQuery(ShopCategoryPageQueryDTO shopCategoryPageQueryDTO);

    /**
     * 批量删除商家分类
     * @param ids
     */
    void deleteByIds(List<Long> ids);

    /**
     *
     * @return
     */
    @Select("select * from shop_category")
    List<ShopCategory> list();

    /**
     * 修改商家分类信息
     * @param shopCategory
     */
    @AutoFill(OperationType.UPDATE)
    void update(ShopCategory shopCategory);
}
